//
//  AppDelegate.m
//  Qihuo
//
//  Created by Vencoo on 13-9-25.
//  Copyright (c) 2013年 Vencoo. All rights reserved.
//



#import "AppDelegate.h"
#import "ViewController.h"

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;
   double version = [[UIDevice currentDevice].systemVersion doubleValue];
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
        [application setStatusBarStyle:UIStatusBarStyleLightContent];
        self.window.clipsToBounds = YES;
//        self.window.frame = CGRectMake(0, 0, self.window.frame.size.width, self.window.frame.size.height);
    }
    else {
//        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    }


//   判断设备版本号
//    [UIDevice currentDevice].
//    NSLog(@"%@",[UIDevice currentDevice]batteryState);
    NSLog(@"%f",version);
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    [self openReadFrid];
    return YES;
    
    
}
- (void)openReadFrid
{
    _xunjianV = [[FridUtil alloc]init];
    _reader = [[IvrJackService alloc]init];
    _reader.delegate = _xunjianV;
    [_reader open];

}
//- (void)closeReadFrid
//{
//    [_reader close];
//}
//- (void) viewDidLayoutSubviews {
//    CGRect viewBounds = self.view.bounds;
//    CGFloat topBarOffset = self.topLayoutGuide.length;
//    viewBounds.origin.y = topBarOffset * -1;
//    self.view.bounds = viewBounds;
//}
- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{

    [_reader didEnterBackground];
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    
    [_reader didBecomeActive];
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
